package com.code.day10;

public class Computer {
    public void start(){
        System.out.println("开机");
    }
    public void useUSB(USB usb){
        if(usb instanceof Mouse mouse){
            mouse.open();
            mouse.click();
            mouse.close();
        }
        if(usb instanceof KeyBoard keyBoard){
            keyBoard.open();
            keyBoard.type();
            keyBoard.close();
        }
    }
    public void shutdown(){
        System.out.println("关机");
    }

}
